package com.dg11185.nearshop.activity.setting;

import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.android.nearshop.R;
import com.dg11185.nearshop.activity.SubPageActivity;

public class AboutUs extends SubPageActivity {

    private TextView versionTxt;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_aboutus);
        setSubPageTitle("关于我们");
        versionTxt = (TextView) this.findViewById(R.id.about_us_version);

        PackageManager manager = getPackageManager();
        PackageInfo info;
        try {
            info = manager.getPackageInfo(getPackageName(), 0);
            versionTxt.setText("常惠生活: v"+ info.versionName);
        } catch (NameNotFoundException e) {
            e.printStackTrace();
        }
    }

    public void onLikeClicked(View v) {

    }

    public void onDealClicked(View v) {
        startActivity(new Intent(this, ProtocalActivity.class));
    }

    public void onPhoneClicked(View v) {
        Uri number = Uri.parse("tel:4006021185");
        Intent dial = new Intent(Intent.ACTION_DIAL, number);
        startActivity(dial);
    }
}
